home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global buttonProp, innDataTable, gFile, gPrevTxt, gPrevious
- set buttonProp to [#plusButton: 0, #minButton: 0, #pButton: 0, #nxtButton: 0, #prvButton: 0, #soundButton: 1, #nameButton: 0]
- set innDataTable to []
- set gPrevTxt to EMPTY
- set gPrevious to EMPTY
- if the machineType = 256 then
- set gFile to FileIO(mnew, "read", the pathName & "data\" & "inData.txt")
- else
- set gFile to FileIO(mnew, "read", the pathName & "data:" & "inData.txt")
- end if
- loadTables()
- end
-
- on loadTables
- global buttonProp, innDataTable, gFile
- set index to 1
- set eofInd to EMPTY
- set theRecord to EMPTY
- repeat while eofInd <> "endData"
- set theRecord to gFile(mReadLine)
- if word 1 of theRecord = "begin" then
- set temp to word 1 of theRecord & " " & word 2 of theRecord
- addAt(innDataTable, index, temp)
- else
- addAt(innDataTable, index, word 1 of theRecord)
- set eofInd to word 1 of theRecord
- end if
- set index to index + 1
- end repeat
- end
-
- on positionCat category
- global innDataTable, buttonProp, pos, theCast, current, gPrevious
- set pos to 0
- set pos to getOne(innDataTable, category)
- set pos to pos + 1
- set theCast to getAt(innDataTable, pos)
- set current to theCast & ".pct"
- set the castNum of sprite 1 to the number of cast current
- if gPrevious = EMPTY then
- nothing()
- else
- unLoadCast(gPrevious)
- end if
- set gPrevious to current
- checkNavigation(4, 5, "next", "previous")
- if getaProp(buttonProp, #soundButton) then
- if the machineType = 256 then
- sound playFile 2, the pathName & "data\sound\" & theCast & ".aif"
- else
- sound playFile 2, the pathName & "data:sound:" & theCast & ".aif"
- end if
- end if
- end
-
- on checkNavigation nextSprite, prevSprite, nextBut, prevBut
- global pos, innDataTable, buttonProp, prv, nxt, curpos
- set curpos to getAt(innDataTable, pos)
- set prv to getAt(innDataTable, pos - 1)
- if word 1 of prv = "begin" then
- setaProp(buttonProp, #prvButton, 1)
- set the castNum of sprite prevSprite to the number of cast (prevBut & "Gray")
- else
- setaProp(buttonProp, #prvButton, 0)
- set the castNum of sprite prevSprite to the number of cast prevBut
- end if
- set nxt to getAt(innDataTable, pos + 1)
- if word 1 of nxt = "end" then
- setaProp(buttonProp, #nxtButton, 1)
- set the castNum of sprite nextSprite to the number of cast (nextBut & "Gray")
- else
- setaProp(buttonProp, #nxtButton, 0)
- set the castNum of sprite nextSprite to the number of cast nextBut
- end if
- updateStage()
- end
-
- on showForward nextSprite, prevSprite, nextBut, prevBut
- global innDataTable, buttonProp, pos, theCast, current, gPrevious
- set pos to pos + 1
- set theCast to getAt(innDataTable, pos)
- set current to theCast & ".pct"
- set the castNum of sprite 1 to the number of cast current
- unLoadCast(gPrevious)
- set gPrevious to current
- checkNavigation(nextSprite, prevSprite, nextBut, prevBut)
- if getaProp(buttonProp, #soundButton) then
- if the machineType = 256 then
- sound playFile 2, the pathName & "data\sound\" & theCast & ".aif"
- else
- sound playFile 2, the pathName & "data:sound:" & theCast & ".aif"
- end if
- end if
- end
-
- on showBack nextSprite, prevSprite, nextBut, prevBut
- global innDataTable, buttonProp, pos, theCast, current, gPrevious
- set pos to pos - 1
- set theCast to getAt(innDataTable, pos)
- set current to theCast & ".pct"
- set the castNum of sprite 1 to the number of cast current
- unLoadCast(gPrevious)
- set gPrevious to current
- checkNavigation(nextSprite, prevSprite, nextBut, prevBut)
- if getaProp(buttonProp, #soundButton) then
- if the machineType = 256 then
- sound playFile 2, the pathName & "data\sound\" & theCast & ".aif"
- else
- sound playFile 2, the pathName & "data:sound:" & theCast & ".aif"
- end if
- end if
- end
-
- on autoPlay
- global innDataTable, buttonProp, pos, whichCat
- positionCat(whichCat)
- set the castNum of sprite 6 to the number of cast "pause"
- set the castNum of sprite 3 to the number of cast "fun facts"
- end
-
- on CheckSound
- global nxt, buttonProp
- if getaProp(buttonProp, #soundButton) then
- if soundBusy(2) then
- nothing()
- else
- if word 1 of nxt = "end" then
- set the castNum of sprite 6 to the number of cast "auto play"
- go("dispCon")
- else
- MakeInvisible(12, 12, 0)
- set the castNum of sprite 3 to the number of cast "fun facts"
- showForward(4, 5, "next", "previous")
- end if
- end if
- else
- if the timer < (60 * 20) then
- nothing()
- else
- if word 1 of nxt = "end" then
- set the castNum of sprite 6 to the number of cast "auto play"
- go("dispCon")
- else
- MakeInvisible(12, 12, 0)
- set the castNum of sprite 3 to the number of cast "fun facts"
- showForward(4, 5, "next", "previous")
- startTimer()
- end if
- end if
- end if
- end
-
- on pausePlay
- set the castNum of sprite 6 to the number of cast "auto play"
- updateStage()
- go("dispCon")
- end
-
- on dispTitles
- global theCast, gPrevTxt
- set the castNum of sprite 11 to the number of cast (theCast & ".ttl")
- set the castNum of sprite 12 to the number of cast (theCast & ".txt")
- updateStage()
- if gPrevTxt = EMPTY then
- nothing()
- else
- unLoadCast(gPrevTxt)
- end if
- set gPrevTxt to theCast & ".txt"
- end
-
- on magnify
- global theCast, magFactor
- set magFactor to magFactor + 1
- set magCast to theCast & magFactor & ".pct"
- set the castNum of sprite 1 to the number of cast magCast
- updateStage()
- checkMagButtons()
- end
-
- on reduce
- global theCast, magFactor
- set magFactor to magFactor - 1
- if magFactor = 1 then
- set magCast to theCast & ".pct"
- set the castNum of sprite 1 to the number of cast magCast
- else
- set magCast to theCast & magFactor & ".pct"
- set the castNum of sprite 1 to the number of cast magCast
- end if
- updateStage()
- checkMagButtons()
- end
-
- on checkMagButtons
- global magFactor
- if (magFactor - 1) < 1 then
- setaProp(buttonProp, #minButton, 1)
- set the castNum of sprite 8 to the number of cast "MIGray"
- else
- setaProp(buttonProp, #minButton, 0)
- set the castNum of sprite 8 to the number of cast "MI"
- end if
- if (magFactor + 1) > 5 then
- setaProp(buttonProp, #plusButton, 1)
- set the castNum of sprite 6 to the number of cast "MGray"
- else
- setaProp(buttonProp, #plusButton, 0)
- set the castNum of sprite 6 to the number of cast "M"
- end if
- updateStage()
- end
-
- on HouseKeeping
- global sportWordH, countryWordH, sportWordV, countryWordV, charCount, dupList, sportInitH, countryInitH, done, currCount, showMe
- set sportWordH to []
- set answer to 0
- set done to 0
- set currCount to 0
- set charCount to 0
- puppetSound(0)
- end
-
- on LoadPos
- global sportWordH, countryWordH, sportWordV, countryWordV, charCount, sportInitH, countryInitH, sportInitV, countryInitV, done, puzzle1V, puzzle2V, puzzle3V, flag1V, flag2V, flag3V
- set puzzle1V to 157
- set puzzle2V to 228
- set puzzle3V to 299
- set done to 0
- loadHorzpos(sportWordH, 2, 19)
- end
-
- on loadHorzpos horzList, startSprite, endSprite
- set index to startSprite
- repeat while index <= endSprite
- addAt(horzList, index, the locH of sprite index)
- set index to index + 1
- end repeat
- end
-
- on PuzzleMove idxNumber, whichSprite, vertPos
- global sportWordH, charCount, inPlace
- if getAt(sportWordH, idxNumber) = 0 then
- exit
- end if
- set horzPos to getAt(sportWordH, idxNumber)
- MoveTheSprite(vertPos, horzPos, 0, 0, whichSprite, "Glass Toast", 0)
- if inPlace then
- setAt(sportWordH, idxNumber, 0)
- set charCount to charCount + 1
- end if
- end
-
- on checkLable
- global puzProp, puzCount, puzLable
- set puzCount to puzCount + 1
- if puzCount = 5 then
- set the castNum of sprite 13 to the number of cast "next puzzleGray"
- updateStage()
- end if
- set puzDup to 1
- repeat while puzDup = 1
- set puzLableSuf to random(10)
- set puzLable to "puzzle" & puzLableSuf
- set nxt to getaProp(puzProp, puzLable)
- if nxt = 1 then
- nothing()
- next repeat
- end if
- set puzDup to 0
- setaProp(puzProp, puzLable, 1)
- end repeat
- end
-